//  src/router/index.ts
import { createRouter, createWebHistory, RouteRecordRaw } from "vue-router";

const Home = () => import("@/views/home/index.vue");

const routes: Array<RouteRecordRaw> = [
  {
    path: "/",
    name: "layout",
    meta: {
      title: "首页",
    },
    redirect:'/home',
    component: () => import("@/views/layout/index.vue"),
    children: [
      {
        path: '/home',
        name: 'home',
        component:() => import("@/views/home/index.vue")
      },
      {
        path: '/detail/:id',
        name: 'detail',
        component:() => import("@/views/detail/index.vue")
      }
    ],
  
  },
];

const router = createRouter({
  history: createWebHistory(),
  routes,
});
export default router;